package com.equipment.management.dao;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.equipment.management.entity.HandleTimer;
import com.equipment.management.entity.Mainframe;
import com.equipment.management.entity.MainframeResult;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;


@Repository
public interface MainframeDao extends BaseMapper<Mainframe> {
    List<Mainframe> selectMainframes(@Param("room_num") String room_num);

    public int addMainframe(Mainframe mainframe);
    public int deleteMainframe(@Param("id") List<String> id);
    public int editMainframe(Mainframe mainframe);

    Mainframe getMainframeByCode(@Param("code")String code);


    List<String> getAllPort(@Param("port")String port);

    List<String> getAllType(@Param("type")String type);

    void updateInitMainframe(@Param("topic") String topic);

    void updateMainframeResult(@Param("topic") String topic, @Param("result") String result,  @Param("return_message")String return_message);

    void closeMainframeResult(@Param("topic")String topic,@Param("result") String result);

    Map getCountByType();

    Map getCountByLevel(@Param("floor_level")String floor_level);

    List<Map> getAllFloorRoom(@Param("floor_level")String floor_level, @Param("room_num")String room_num);

    int getScanMainFrame(List<String> list);

    List<Map> getLog(@Param("code")String code, @Param("operate")String operate);

    void insertMainframeResult(MainframeResult m);

    void deleteMainframeResult(@Param("code")String code, @Param("random")String random);

    List<String> getMainframeResult( @Param("topic")String topic, @Param("result") String result);

    void insertTimer(HandleTimer m);

    int getTimer(@Param("random")String random);

    int getTimerbyrandom(@Param("random")String random);

    int getWhiteframe(@Param("code")String code);

    int getBlackframe(@Param("code")String code);

    int getMainframeResultbyrandom(@Param("code")String code, @Param("random")String random);

    String getMainframeScanResultbyrandom(@Param("code")String code, @Param("random")String random);
}
